package com.mz.demo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

@Data
@Accessors(chain = true)
public class SysPermission {

    private Long id;
    private Long parentId;
    private Integer level;
    private String permissionName;
    private String permissionCode;
    private Integer type;

    @TableField( exist = false )
    private List<SysPermission> children;

    @JsonIgnore
    @TableLogic
    private Integer delFlag;

    @JsonFormat( pattern = "YYYY-MM-DD HH:mm:ss")
    @TableField( fill = FieldFill.INSERT)
    private Date createTime;
}
